home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- NNNNAAAAMMMMEEEE
- zshcompctl - zsh programmable completion
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- ccccoooommmmppppccccttttllll [ -CCCCDDDDTTTT ] _o_p_t_i_o_n_s [ _c_o_m_m_a_n_d ... ]
-
- ccccoooommmmppppccccttttllll [ -CCCCDDDDTTTT ] _o_p_t_i_o_n_s
- [ -xxxx _p_a_t_t_e_r_n _o_p_t_i_o_n_s - ... -- ]
- [ ++++ _o_p_t_i_o_n_s [ -xxxx ... -- ] ... [+] ]
- [ _c_o_m_m_a_n_d ... ]
-
- ccccoooommmmppppccccttttllll -LLLL [ -CCCCDDDDTTTT ] [ _c_o_m_m_a_n_d ... ]
-
- ccccoooommmmppppccccttttllll + _c_o_m_m_a_n_d ...
-
- Control the editor's completion behavior according to the
- supplied set of _o_p_t_i_o_n_s. Various editing commands, notably
- eeeexxxxppppaaaannnndddd----oooorrrr----ccccoooommmmpppplllleeeetttteeee----wwwwoooorrrrdddd, usually bound to TTTTAAAABBBB, will attempt
- to complete a word typed by the user, while others, notably
- ddddeeeelllleeeetttteeee----cccchhhhaaaarrrr----oooorrrr----lllliiiisssstttt, usually bound to ^D in emacs editing
- mode, list the possibilities; ccccoooommmmppppccccttttllll controls what those
- possibilities are. They may for example be filenames (the
- most common case, and hence the default), shell variables,
- or words from a user-specified list.
-
- CCCCOOOOMMMMMMMMAAAANNNNDDDD FFFFLLLLAAAAGGGGSSSS
- Completion of the arguments of a command may be different
- for each command or may use the default. The behavior when
- completing the command word itself may also be separately
- specified. These correspond to the following flags and
- arguments, all of which (except for -LLLL) may be combined with
- any combination of the _o_p_t_i_o_n_s described subsequently in the
- section OOOOPPPPTTTTIIIIOOOONNNN FFFFLLLLAAAAGGGGSSSS:
-
- _c_o_m_m_a_n_d ...
- controls completion for the named commands, which
- must be listed last on the command line. If
- completion is attempted for a command with a
- pathname containing slashes and no completion
- definition is found, the search is retried with
- the last pathname component. Note that aliases
- are expanded before the command name is determined
- unless the CCCCOOOOMMMMPPPPLLLLEEEETTTTEEEE____AAAALLLLIIIIAAAASSSSEEEESSSS option is set.
- Commands should not be combined with the -DDDD, -CCCC or
- -TTTT flags.
- -DDDD controls default completion behavior for the
- arguments of commands not assigned any special
- behavior. If no ccccoooommmmppppccccttttllll ----DDDD command has been
- issued, filenames are completed.
- -CCCC controls completion when the command word itself
- is being completed. If no ccccoooommmmppppccccttttllll ----CCCC command has
- been issued, the names of any executable command
-
-
-
- Page 1 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- (whether in the path or specific to the shell,
- such as aliases or functions) are completed.
- -TTTT supplies completion flags to be used before any
- other processing is done, even those given to
- specific commands with other compctl definitions.
- This is only useful when combined with extended
- completion (the -xxxx flag, see the section EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD
- CCCCOOOOMMMMPPPPLLLLEEEETTTTIIIIOOOONNNN below). Using this flag you can define
- default behavior which will apply to all commands
- without exception, or you can alter the standard
- behavior for all commands. For example, if your
- access to the user database is too slow and/or it
- contains too many users (so that completion after
- ~~~~ is too slow to be usable), you can use
- compctl -Tx 'C[0,*/*]' -f - 's[~]' -k friends -S/
- to complete the strings in the array ffffrrrriiiieeeennnnddddssss after
- a ~~~~. The first argument is necessary so that this
- form of ~-completion is not tried after the
- directory name is finished.
- -LLLL lists the existing completion behavior in a manner
- suitable for putting into a start-up script; the
- existing behavior is not changed. Any combination
- of the above forms may be specified, otherwise all
- defined completions are listed. Any other flags
- supplied are ignored.
- _n_o _a_r_g_u_m_e_n_t
- If no argument is given, ccccoooommmmppppccccttttllll lists all defined
- completions in an abbreviated form; with a list
- of _o_p_t_i_o_n_s, all completions with those flags set
- (not counting extended completion) are listed.
-
- If the + flag is alone and followed immediately by the
- _c_o_m_m_a_n_d list, the completion behavior for all the
- commands in the list is reset to the default. In other
- words, completion will subsequently use the options
- specified by the -DDDD flag.
-
- OOOOPPPPTTTTIIIIOOOONNNN FFFFLLLLAAAAGGGGSSSS
- [ -ffffccccFFFFBBBBddddeeeeaaaaRRRRGGGGoooovvvvNNNNAAAAIIIIOOOOPPPPZZZZEEEEnnnnbbbbjjjjrrrrzzzzuuuu ]
- [ -kkkk _a_r_r_a_y ] [ -gggg _g_l_o_b_s_t_r_i_n_g ] [ -ssss _s_u_b_s_t_s_t_r_i_n_g ]
- [ -KKKK _f_u_n_c_t_i_o_n ] [ -HHHH _n_u_m _p_a_t_t_e_r_n ]
- [ -QQQQ ] [ -PPPP _p_r_e_f_i_x ] [ -SSSS _s_u_f_f_i_x ]
- [ -qqqq ] [ -XXXX _e_x_p_l_a_n_a_t_i_o_n ]
- [ -llll _c_m_d ] [ -UUUU ]
-
- The remaining _o_p_t_i_o_n_s specify the type of command arguments
- to look for during completion. Any combination of these
- flags may be specified; the result is a sorted list of all
- the possibilities. The options are as follows.
-
- SSSSiiiimmmmpppplllleeee ffffllllaaaaggggssss
- These produce completion lists made up by the shell itself:
-
-
-
- Page 2 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- -ffff Filenames and filesystem paths.
- -cccc Command names, including aliases, shell functions,
- builtins and reserved words.
- -FFFF Function names.
- -BBBB Names of builtin commands.
- -mmmm Names of external commands.
- -wwww Reserved words.
- -aaaa Alias names.
- -RRRR Names of regular (non-global) aliases.
- -GGGG Names of global aliases.
- -dddd This can be combined with -FFFF, -BBBB, -wwww, -aaaa, -RRRR and
- -GGGG to get names of disabled functions, builtins,
- reserved words or aliases.
- -eeee This option (to show enabled commands) is in
- effect by default, but may be combined with -dddd;
- -ddddeeee in combination with -FFFF, -BBBB, -wwww, -aaaa, -RRRR and -GGGG
- will complete names of functions, builtins,
- reserved words or aliases whether or not they are
- disabled.
- -oooo Names of shell options (see the zshoptions manual
- page).
- -vvvv Names of any variable defined in the shell.
- -NNNN Names of scalar (non-array) parameters.
- -AAAA Array names.
- -IIII Names of integer variables.
- -OOOO Names of read-only variables.
- -pppp Names of parameters used by the shell (including
- special parameters).
- -ZZZZ Names of shell special parameters.
- -EEEE Names of environment variables.
- -nnnn Named directories.
- -bbbb Key binding names.
- -jjjj Job names: the first word of the job leader's
- command line. This is useful with the kkkkiiiillllllll
- builtin.
- -rrrr Names of running jobs.
- -zzzz Names of suspended jobs.
- -uuuu User names.
- FFFFllllaaaaggggssss wwwwiiiitttthhhh aaaarrrrgggguuuummmmeeeennnnttttssss
- These have user supplied arguments to determine how the list
- of completions is to be made up:
- -kkkk _a_r_r_a_y
- Names taken from the elements of $$$$aaaarrrrrrrraaaayyyy (note that
- the $$$$ does not appear on the command line).
- Alternatively, the argument _a_r_r_a_y itself may be a
- set of space- or comma-separated values in
- parentheses, in which any delimiter may be escaped
- with a backslash; in this case the argument should
- be quoted. For example,
- compctl -k "(cputime filesize datasize stacksize
- coredumpsize resident descriptors)" limit
- -gggg _g_l_o_b_s_t_r_i_n_g
-
-
-
- Page 3 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- The _g_l_o_b_s_t_r_i_n_g is expanded using filename
- globbing; it should be quoted to protect it from
- immediate expansion. The resulting filenames are
- taken as the possible completions. Use `*(/)'
- instead of `*/' for directories. The ffffiiiiggggnnnnoooorrrreeee
- special parameter is not applied to the resulting
- files. More than one pattern may be given
- separated by blanks. (Note that brace expansion is
- _n_o_t part of globbing. Use the syntax
- `(either|or)' to match alternatives.)
- -ssss _s_u_b_s_t_s_t_r_i_n_g
- The _s_u_b_s_t_s_t_r_i_n_g is split into words and these
- words are than expanded using all shell expansion
- mechanisms (see the zzzzsssshhhheeeexxxxppppnnnn manual page). The
- resulting words are taken as possible completions.
- The ffffiiiiggggnnnnoooorrrreeee special parameter is not applied to
- the resulting files. Note that -gggg is faster for
- filenames.
- -KKKK _f_u_n_c_t_i_o_n
- Call the given function to get the completions.
- The function is passed two arguments: the prefix
- and the suffix of the word on which completion is
- to be attempted, in other words those characters
- before the cursor position, and those from the
- cursor position onwards. The function should set
- the variable rrrreeeeppppllllyyyy to an array containing the
- completions (one completion per element); note
- that rrrreeeeppppllllyyyy should not be made local to the
- function. From such a function the command line
- can be accessed with the ----cccc and ----llll flags to the
- rrrreeeeaaaadddd builtin. For example,
- function whoson { reply=(`users`); }
- compctl -K whoson talk
- completes only logged-on users after `talk'. Note
- that `whoson' must return an array so that
- "reply=`users`" is incorrect.
- -HHHH _n_u_m _p_a_t_t_e_r_n
- The possible completions are taken from the last
- _n_u_m history lines. Only words matching _p_a_t_t_e_r_n are
- taken. If _n_u_m is zero or negative the whole
- history is searched and if _p_a_t_t_e_r_n is the empty
- string all words are taken (as with `****'). A
- typical use is
- compctl -D -f + -H 0 '' \
- -X '(No file found; using history)'
- which forces completion to look back in the
- history list for a word if no filename matches.
- The explanation string is useful as it tells the
- user that no file of that name exists, which is
- otherwise ambiguous. (See the next section for
- -XXXX).
- CCCCoooonnnnttttrrrroooollll ffffllllaaaaggggssss
-
-
-
- PPPPaaaaggggeeee 4444 ((((pppprrrriiiinnnntttteeeedddd 4444////22224444////99998888))))
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- These do not directly specify types of name to be completed,
- but manipulate the options that do:
- -QQQQ This instructs the shell not to quote any
- metacharacters in the possible completions.
- Normally the results of a completion are inserted
- into the command line with any metacharacters
- quoted so that they are interpreted as normal
- characters. This is appropriate for filenames and
- ordinary strings. However, for special effects,
- such as inserting a backquoted expression from a
- completion array (-kkkk) so that the expression will
- not be evaluated until the complete line is
- executed, this option must be used.
- -PPPP _p_r_e_f_i_x
- The _p_r_e_f_i_x is inserted just before the completed
- string; any initial part already typed will be
- completed and the whole _p_r_e_f_i_x ignored for
- completion purposes. For example,
- compctl -j -P "%" kill
- inserts a `%' after the kill command and then
- completes job names.
- -SSSS _s_u_f_f_i_x
- When a completion is found the _s_u_f_f_i_x is inserted
- after the completed string. In the case of menu
- completion the suffix is inserted immediately, but
- it is still possible to cycle through the list of
- completions by repeatedly hitting the same key.
- -qqqq If used with a suffix as specified by the previous
- option, this causes the suffix to be removed if
- the next character typed is a blank or does not
- insert anything (the same rule as used for the
- AAAAUUUUTTTTOOOO____RRRREEEEMMMMOOOOVVVVEEEE____SSSSLLLLAAAASSSSHHHH option). The option is most
- useful for list separators (comma, colon, etc.).
- -llll _c_m_d
- This option cannot be combined with any other. It
- restricts the range of command line words that are
- considered to be arguments. If combined with one
- of the extended completion patterns `pppp[...]',
- `rrrr[...]', or `RRRR[...]' (see the section EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD
- CCCCOOOOMMMMPPPPLLLLEEEETTTTIIIIOOOONNNN below) the range is restricted to the
- range of arguments specified in the brackets.
- Completion is then performed as if these had been
- given as arguments to the _c_m_d supplied with the
- option. If the _c_m_d string is empty the first word
- in the range is instead taken as the command name,
- and command name completion performed on the first
- word in the range. For example,
- compctl -x 'r[-exec,;]' -l '' -- find
- completes arguments between `-exec' and the
- following `;' (or the end of the command line if
- there is no such string) as if they were a
- separate command line.
-
-
-
- Page 5 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- -UUUU Use the whole list of possible completions,
- whether or not they actually match the word on the
- command line. The word typed so far will be
- deleted. This is most useful with a function
- (given by the -KKKK option) which can examine the
- word components passed to it (or via the rrrreeeeaaaadddd
- builtin's -cccc and -llll flags) and use its own
- criteria to decide what matches. If there is no
- completion, the original word is retained.
- -XXXX _e_x_p_l_a_n_a_t_i_o_n
- Print _e_x_p_l_a_n_a_t_i_o_n when trying completion on the
- current set of options. A `%n' in this string is
- replaced by the number of matches.
-
- AAAALLLLTTTTEEEERRRRNNNNAAAATTTTIIIIVVVVEEEE CCCCOOOOMMMMPPPPLLLLEEEETTTTIIIIOOOONNNN
- ccccoooommmmppppccccttttllll [ -CCCCDDDDTTTT ] _o_p_t_i_o_n_s + _o_p_t_i_o_n_s [ + ... ] [ + ] _c_o_m_m_a_n_d
- ...
-
- The form with `++++' specifies alternative options. Completion
- is tried with the options before the first `+'. If this
- produces no matches completion is tried with the flags after
- the `+' and so on. If there are no flags after the last `+'
- and a match has not been found up to that point, default
- completion is tried.
-
- EEEEXXXXTTTTEEEENNNNDDDDEEEEDDDD CCCCOOOOMMMMPPPPLLLLEEEETTTTIIIIOOOONNNN
- ccccoooommmmppppccccttttllll [ -CCCCDDDDTTTT ] _o_p_t_i_o_n_s -xxxx _p_a_t_t_e_r_n _o_p_t_i_o_n_s - ... -- [
- _c_o_m_m_a_n_d ... ]
-
- ccccoooommmmppppccccttttllll [ -CCCCDDDDTTTT ] _o_p_t_i_o_n_s [ -xxxx _p_a_t_t_e_r_n _o_p_t_i_o_n_s - ... -- ]
- [ ++++ _o_p_t_i_o_n_s [ -xxxx ... -- ] ... [+] ] [ _c_o_m_m_a_n_d ... ]
-
- The form with `-xxxx' specifies extended completion for the
- commands given; as shown, it may be combined with
- alternative completion using +. Each _p_a_t_t_e_r_n is examined in
- turn; when a match is found, the corresponding _o_p_t_i_o_n_s, as
- described in the section OOOOPPPPTTTTIIIIOOOONNNN FFFFLLLLAAAAGGGGSSSS above, are used to
- generate possible completions. If no _p_a_t_t_e_r_n matches, the
- _o_p_t_i_o_n_s given before the -xxxx are used.
-
- Note that each pattern should be supplied as a single
- argument and should be quoted to prevent expansion of
- metacharacters by the shell.
-
- A _p_a_t_t_e_r_n is built of sub-patterns separated by commas; it
- matches if at least one of these sub-patterns matches (they
- are `or'ed'). These sub-patterns are in turn composed of
- other sub-patterns separated by white spaces which match if
- all of the sub-patterns match (they are `and'ed'). An
- element of the sub-patterns is of the form `c[...][...]',
- where the pairs of brackets may be repeated as often as
- necessary, and matches if any of the sets of brackets match
-
-
-
- Page 6 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- (an `or'). The example below makes this clearer.
-
- The elements may be any of the following:
-
-
- ssss[_s_t_r_i_n_g] ...
- Matches if the current word on the command line
- starts with one of the strings given in brackets.
- The _s_t_r_i_n_g is not removed and is not part of the
- completion.
- SSSS[_s_t_r_i_n_g] ...
- Like ssss[_s_t_r_i_n_g] except that the _s_t_r_i_n_g is part of
- the completion.
- pppp[_f_r_o_m,_t_o] ...
- Matches if the number of the current word is
- between one of the _f_r_o_m and _t_o pairs inclusive.
- The comma and _t_o are optional; _t_o defaults to the
- same value as _f_r_o_m. The numbers may be negative:
- -_n refers to the _n'th last word on the line.
- cccc[_o_f_f_s_e_t,_s_t_r_i_n_g] ...
- Matches if the _s_t_r_i_n_g matches the word offset by
- _o_f_f_s_e_t from the current word position. Usually
- _o_f_f_s_e_t will be negative.
- CCCC[_o_f_f_s_e_t,_p_a_t_t_e_r_n] ...
- Like cccc but using pattern matching instead.
- wwww[_i_n_d_e_x,_s_t_r_i_n_g] ...
- Matches if the word in position _i_n_d_e_x is equal to
- the corresponding _s_t_r_i_n_g. Note that the word
- count is made after any alias expansion.
- WWWW[_i_n_d_e_x,_p_a_t_t_e_r_n] ...
- Like wwww but using pattern matching instead.
- nnnn[_i_n_d_e_x,_s_t_r_i_n_g] ...
- Matches if the current word contains _s_t_r_i_n_g.
- Anything up to and including the _i_n_d_e_x'th
- occurrence of this string will not be considered
- part of the completion, but the rest will. _I_n_d_e_x
- may be negative to count from the end: in most
- cases, _i_n_d_e_x will be 1 or -1.
- NNNN[_i_n_d_e_x,_s_t_r_i_n_g] ...
- Like nnnn[_i_n_d_e_x,_s_t_r_i_n_g] except that the string will
- be taken as a character class. Anything up to and
- including the _i_n_d_e_x'th occurrence of any of the
- characters in _s_t_r_i_n_g will not be considered part
- of the completion.
- mmmm[_m_i_n,_m_a_x] ...
- Matches if the total number of words lies between
- _m_i_n and _m_a_x inclusive.
- rrrr[_s_t_r_1,_s_t_r_2]...
- Matches if the cursor is after a word with prefix
- _s_t_r_1. If there is also a word with prefix _s_t_r_2 on
- the command line it matches only if the cursor is
- before this word.
-
-
-
- Page 7 (printed 4/24/98)
-
-
-
-
-
-
- ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111)))) zzzzsssshhhh vvvveeeerrrrssssiiiioooonnnn 3333....0000 ((((JJJJuuuunnnneeee 22226666,,,, 1111999999996666)))) ZZZZSSSSHHHHCCCCOOOOMMMMPPPPCCCCTTTTLLLL((((1111))))
-
-
-
- RRRR[_s_t_r_1,_s_t_r_2]...
- Like rrrr but using pattern matching instead.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- compctl -u -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' \
- - 's[-f],c[-1,-f]' -f -- mail
-
- This is to be interpreted as follows:
-
- If the current command is mmmmaaaaiiiillll, then
-
- if ((the current word begins with + and the previous
- word is -f) or (the current word begins with -f+)),
- then complete the non-directory part (the :t glob
- modifier) of files in the directory ~/Mail; else
-
- if the current word begins with -f or the previous word
- was -f, then complete any file; else
-
- complete user names.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 8 (printed 4/24/98)
-
-
-
-